package me.wangqu.weiyouqu.web.rest;

import me.wangqu.weiyouqu.web.rest.business.model.VersionModel;
import me.wangqu.weiyouqu.web.rest.business.service.VersionService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


/**
 * Created by joln on 2016/7/30.
 */
@RestController
@RequestMapping(value = "/api")
public class VersionResource {

    private Logger logger = LoggerFactory.getLogger(VersionResource.class);

    @Autowired
    private VersionService versionService;

    @RequestMapping(value = "/version"
        , method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
    public ResponseEntity<VersionModel> getVersionData() {
        return new ResponseEntity<VersionModel>(versionService.getVersionData(), HttpStatus.OK);
    }


}

